package com.txz.system.service.impl;

import java.util.List;
import com.txz.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.txz.system.mapper.ZcnBrandMapper;
import com.txz.system.domain.ZcnBrand;
import com.txz.system.service.IZcnBrandService;

/**
 * 商品品牌Service业务层处理
 * 
 * @author tuxiaozhuo
 * @date 2025-10-20
 */
@Service
public class ZcnBrandServiceImpl implements IZcnBrandService 
{
    @Autowired
    private ZcnBrandMapper zcnBrandMapper;

    /**
     * 查询商品品牌
     * 
     * @param id 商品品牌主键
     * @return 商品品牌
     */
    @Override
    public ZcnBrand selectZcnBrandById(Long id)
    {
        return zcnBrandMapper.selectZcnBrandById(id);
    }

    /**
     * 查询商品品牌列表
     * 
     * @param zcnBrand 商品品牌
     * @return 商品品牌
     */
    @Override
    public List<ZcnBrand> selectZcnBrandList(ZcnBrand zcnBrand)
    {
        return zcnBrandMapper.selectZcnBrandList(zcnBrand);
    }

    /**
     * 新增商品品牌
     * 
     * @param zcnBrand 商品品牌
     * @return 结果
     */
    @Override
    public int insertZcnBrand(ZcnBrand zcnBrand)
    {
        zcnBrand.setCreateTime(DateUtils.getNowDate());
        return zcnBrandMapper.insertZcnBrand(zcnBrand);
    }

    /**
     * 修改商品品牌
     * 
     * @param zcnBrand 商品品牌
     * @return 结果
     */
    @Override
    public int updateZcnBrand(ZcnBrand zcnBrand)
    {
        zcnBrand.setUpdateTime(DateUtils.getNowDate());
        return zcnBrandMapper.updateZcnBrand(zcnBrand);
    }

    /**
     * 批量删除商品品牌
     * 
     * @param ids 需要删除的商品品牌主键
     * @return 结果
     */
    @Override
    public int deleteZcnBrandByIds(Long[] ids)
    {
        return zcnBrandMapper.deleteZcnBrandByIds(ids);
    }

    /**
     * 删除商品品牌信息
     * 
     * @param id 商品品牌主键
     * @return 结果
     */
    @Override
    public int deleteZcnBrandById(Long id)
    {
        return zcnBrandMapper.deleteZcnBrandById(id);
    }
}
